package com.happy016.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
//配置刷新(手动刷新) 如果配置有修改 http://localhost:8829/refresh 刷新生效
//可以使用Spring Cloud Bus实现自动刷新 ps:这里不举例
public class ConfigClientController {

    @Value("${profile}")
    private String profile;

    @GetMapping("/profile")
    public String profile(){
        return profile;
    }
}
